package com.cg.util.token.md5Util;

import com.cg.util.token.ConstantUtil;
import org.springframework.util.DigestUtils;

public class Md5Util extends DigestUtils {

    /**
     * @Author ZC
     * @Description //TODO md5加密
     * @Date 16:48
     * @Param []
     * @return java.lang.String
     **/
    public static String md5Dispose(Object... objects ){
        StringBuffer strb = new StringBuffer();
        for (Object parameter :
                objects) {
            try {
                strb.append(md5DigestAsHex(parameter.toString().getBytes()));
            }catch (Exception e){
                e.printStackTrace();
            }
        }
        return DigestUtils.md5DigestAsHex((strb.append(ConstantUtil.ENCRYPTION_KEY()).toString().getBytes()));
    }

}
